package com.liuzhilong.infrastructure.basic.jdk.spi;

import java.util.Iterator;
import java.util.ServiceLoader;

public class UseCase {

    public static void main(String[] args){
        ServiceLoader<TestService> loadedDrivers = ServiceLoader.load(TestService.class);
        Iterator<TestService> driversIterator = loadedDrivers.iterator();
        while (driversIterator.hasNext()) {
            System.out.println(driversIterator.next().someService());
        }

    }


}
